package com.example.bijiabao.servicesImpl;

import com.example.bijiabao.entity.book;
import com.example.bijiabao.entity.bookPlatform;
import com.example.bijiabao.entity.user;
import org.springframework.beans.factory.annotation.Autowired;
import com.example.bijiabao.services.spbookServices;
import com.example.bijiabao.mapper.spbookMapper;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class spbookServicesImpl implements spbookServices {
    @Autowired
    private spbookMapper spbookMapper;

    //连接book,platform,通过ISBN查询
    @Override
    public List<bookPlatform> findAllBookByISBN(String ISBN) {
        List<bookPlatform> list = spbookMapper.findAllBookByISBN(ISBN);
        return list;
    }

    //详情页最便宜商品
    @Override
    public bookPlatform findBookByISBN(String ISBN) {

        return spbookMapper.findBookByISBN(ISBN);
    }

    //相同作者的书
    @Override
    public List<book> findBookByWrietr(String writer) {
        List<book> list = spbookMapper.findBookByWrietr(writer);
        return list;
    }

    @Override
    public user selectbyUserName(String userName) {
        return spbookMapper.selectbyUserName(userName);
    }
}
